
import Vue from "vue"
const directiveList = require.context("./src", true, /\.js$/)
directiveList.keys().forEach(fileName => {
  const file = directiveList(fileName)
  for (const key in file) {
    if (typeof (file[key]) === "object") {
      Vue.directive(key, file[key])
    } else if (typeof (file[key]) === "function") {
      Vue.directive(key, {
        inserted: file[key]
      })
    }
  }
})